<?php
/**
 * Created by Command.
 * User: Vito
 */

// declare (strict_types = 1);

namespace app\admin\controller\v1;

use app\admin\controller\BaseController;
use app\logic\CheckInLogic;

class CheckIn extends BaseController
{
    protected $name = '入住';

    protected $registerCurd = true;

    protected $registerCurdDir = true;

    protected $methodName = [
        'getLessee'         => '获取租户',
        'getTenantList'     => '获取全部租户信息',
        'getRoomDetail'     => '获取房间详情'
    ];
    /**
     * 初始化
     */
    protected function initialize()
    {
        $this->logic = new CheckInLogic();
    }
    /**
     * @Description: 获取房间内的全部租户
     * @author: xiayu <cb1071403016@126.com>
     * @Date: 2022-10-27 17:30:04
     * @version: 1.0.0
     * @return [type]
     */
    public function getLessee(){

        $params = $this->request->get();

        $res = $this->logic->Lessee($params);

        if ($res) {
            return success($res, '获取成功');
        } else {
            return error('获取失败');
        }
    }
    /**
     * @Description: 获取全部租户信息(导出数据)
     * @author: xiayu <cb1071403016@126.com>
     * @Date: 2022-12-01 15:39:23
     * @version: 1.0.0
     * @return [type]
     */
    public function getTenantList(){
        $params = $this->request->get();
        $res = $this->logic->getTenantList($params);
        if ($res) {
            return success($res, '获取成功');
        } else {
            return error('获取失败');
        }
    }

    /**
     * @Description: 获取房间详情
     * @author: xiayu <cb1071403016@126.com>
     * @Date: 2022-12-02 17:33:25
     * @version: 1.0.0
     * @return [type]
     */    
    public function getRoomDetail(){
        $params = $this->request->get();
        $res = $this->logic->getRoomDetail($params);
        return success($res, '获取成功');
    }
}
